package com.dense.kuiniu.floatcabinet.mvp.http.api.service;


import com.dense.kuiniu.floatcabinet.mvp.http.entity.AdminBean;
import com.dense.kuiniu.floatcabinet.mvp.http.entity.BaseResponse;
import com.dense.kuiniu.floatcabinet.mvp.http.entity.Book;
import com.dense.kuiniu.floatcabinet.mvp.http.entity.Inventory;
import com.dense.kuiniu.floatcabinet.mvp.http.entity.Reader;
import com.dense.kuiniu.floatcabinet.mvp.http.post.AuthenticationBody;
import com.dense.kuiniu.floatcabinet.mvp.http.post.BorrowOrBackBody;
import com.dense.kuiniu.floatcabinet.mvp.http.post.InventoryBody;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @author Administrator
 * @date 2020/10/29
 */
public interface CommonService {
    @FormUrlEncoded
    @POST("/manage/product/category/item/list")
    Observable<BaseResponse<AdminBean>> adminLogin(
            @Field("account") String account, @Field("password") String password
    );

    @POST("/equipment/driftCabinet/authentication")
    Observable<BaseResponse<Reader>> readerAuthentication(@Body AuthenticationBody body);


    @POST("/equipment/driftCabinet/borrowBooks")
    Observable<BaseResponse<Reader>> borrow(@Body BorrowOrBackBody body);

    @POST("/equipment/driftCabinet/returnBooks")
    Observable<BaseResponse<List<Book>>> back(@Body BorrowOrBackBody body);

    @POST("/equipment/driftCabinet/inventory")
    Observable<BaseResponse<Inventory>> inventory(@Body InventoryBody body);
} 